package com.hxzy.pojo;

/**
 * @author wzm
 * @create 2023-09-05 9:37
 * project_name:javaweb2308
 */
public class Student {
    private Integer id;
    private String name;
    private  Integer age;

    //构造函数
    public Student() {
    }

    //私有构造器
    private Student(String name, Integer age) {
        this.name = name;
        this.age = age;
    }

    public Student(Integer id, String name, Integer age) {
        this.id = id;
        this.name = name;
        this.age = age;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Student{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", age=" + age +
                '}';
    }


    //定义类的成员方法
    public void sleep(){
        System.out.println("睡觉");
    }

    private String eat(String f){
        return "吃"+f;
    }

    private String sayHello(String talk){
        System.out.println("学生打招呼");
        return talk;
    }



}
